package cash.cmp.personal_financial_system.mapper;

import cash.cmp.personal_financial_system.model.account.Account;
import cash.cmp.personal_financial_system.model.Role;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface AccountMapper {
    //喜子啊，我给你写好好多方法在这里，不够你写注释说，或者直接发文档给我
    //这个方法获取密码，我直接封装成立Account对象，你在里面拿
    public Account getAccount(String tel);

    //自动注入自增id
    public Boolean register(Account account);

    public Account accountLogin(String tel, String password);

    public List<Role> getAccountRolesById(Integer id);

    //通过用户id和权限名插入user_role表
    public Boolean giveAccountRolesById(Integer id,String name);

    public Boolean updateAccount(Account account);

    public Boolean updateObjectID(Integer id, Integer objectId);

    public Boolean deleteAccount(Integer id);

    public Boolean saveList(List<Account> list);

}
